import Vue from 'vue'
import Router from 'vue-router'
import HelloWorld from '@/components/HelloWorld'
import Login from '@/components/Login'
import Register from '@/components/Register'
import Index from '@/components/Index'
import GoodsList from '@/components/GoodsList'

//导入manager文件夹下的内容
import Manage from '@/manager/Manage'
import AddCate from '@/components/AddCate'
import AddGoods from '@/components/AddGoods'



Vue.use(Router)

export default new Router({
  routes: [
    {
      path: '/hello',
      name: 'HelloWorld',
      component: HelloWorld
    },
    {
      path: '/login',
      name: 'Login',
      component: Login
    },
    {
      path: '/register',
      name: 'Register',
      component: Register
    },
    {
      path: '/',
      name: 'Index',
      component: Index
    },
    {
      path: '/goodslist/:cid',
      name: 'GoodsList',
      component: GoodsList
    },
    {
      path: '/manage',
      name: 'Manage',
      component: Manage,
      // 配子路由
    //   children: [
    //     {
    //       path:"/manage",
    //       component: () => import('@/manager/Manage')
    //     },
    //     {
    //       path:'/manage/add_cate',
    //       component: () => import('@/manager/AddCate')
    //     },
    // ]
    },
    {
      path: '/addcate',
      name: 'AddCate',
      component: AddCate
    },
    {
      path: '/addgoods',
      name: 'AddGoods',
      component: AddGoods
    },
  ]
})
